﻿namespace YZAutoDWR.Response;

public static class ResponseMsg
{
    public static string GetMsg(this ResponseType responseType)
    {
        var msg = responseType switch
        {
            ResponseType.LoginExpiration => "登录已过期,请重新登录",
            ResponseType.TokenExpiration => "Token已过期,请重新登录",
            ResponseType.AccountLocked => "账号已被锁定",
            ResponseType.LoginSuccess => "登录成功",
            ResponseType.ParametersLack => "参数不完整",
            ResponseType.NoPermissions => "没有权限操作",
            ResponseType.NoRolePermissions => "角色没有权限操作",
            ResponseType.ServerError => "服务器好像出了点问题.....",
            ResponseType.LoginError => "用户名或密码错误",
            ResponseType.SaveSuccess => "保存成功",
            ResponseType.NoKey => "没有主键不能编辑",
            ResponseType.NoKeyDel => "没有主键不能删除",
            ResponseType.KeyError => "主键不正确或没有传入主键",
            ResponseType.EditSuccess => "编辑成功",
            ResponseType.DelSuccess => "删除成功",
            ResponseType.RegisterSuccess => "注册成功",
            ResponseType.AuditSuccess => "审核成功",
            ResponseType.ModifyPwdSuccess => "密码修改成功",
            ResponseType.OperSuccess => "操作成功",
            ResponseType.PinError => "验证码不正确",
            _ => responseType.ToString()
        };

        return msg;
    }
}